package br.com.dataphonebr.specification;

import android.content.Context;
import br.com.dataphonebr.R;
import br.com.dataphonebr.dao.impl.GenericDao;
import br.com.dataphonebr.entity.Entity;

public class GenericSpecification<E extends Entity> implements IGenericSpecification<Entity> {

	protected Context context;
	protected GenericDao<E> dao;
	
	protected String getMandatoryStandardMessage(int resIdField){
		String field = context.getString(resIdField);
		return context.getString(R.string.wrn_appoint_title_mandatory, "'"+field+"'");
	}
	
	public GenericSpecification(Context context) {
		this.context = context;
	}
	
	@Override
	public String persistSpecification(Entity instance) {
		return null;
	}

	@Override
	public String deleteSpecification(Entity instance) {
		if (instance.getCodigo() == null){
//			Nao eh possivel alterar
		}
		return null;
	}

	@Override
	public String updateSpecification(Entity instance) {
		if (instance.getCodigo() == null){
//			Nao eh possivel alterar
		}
		return null;
	}
	
}
